feat: migrate to harvest v3 - #2891
Conversation
5f51bc5 to
9acd692
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2891 +/- ##
==========================================
+ Coverage 74.14% 74.86% +0.71%
==========================================
Files 19 19
Lines 2352 2566 +214
==========================================
+ Hits 1744 1921 +177
- Misses 608 645 +37
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR migrates Canonical’s /careers integration from the legacy Harvest v1 API-key client to a new Harvest v3 client (OAuth2 client-credentials), updating the job details/application flow and candidate dashboard logic to consume v3 resources and question models. It also renames environment variables across local/CI/deploy configuration and updates test coverage accordingly.
Changes:
- Introduces a new
HarvestV3client with bearer-token auth + caching, and updates all call sites to use it. - Rebuilds the job application form model from Harvest v3
questions, including multi-select submission handling. - Updates application withdrawal handling (reason normalization + validation) and refreshes unit tests/fixtures and environment configuration.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
webapp/greenhouse.py |
Adds Harvest v3 OAuth client, token cache, v3 list/pagination helpers, and multi-select payload normalization for job applications. |
webapp/application.py |
Reworks candidate dashboard data assembly and withdrawal flow to use Harvest v3 endpoints and normalized withdrawal reasons. |
webapp/app.py |
Switches job details to Harvest v3, builds the new question model for the application form, and adjusts location/is_remote handling. |
templates/careers/job-detail.html |
Renders the new application_questions model and updates JSON-LD location/datePosted behavior. |
templates/careers/base_job-details.html |
Updates location rendering to match the new job.location shape. |
templates/careers/application/index.html |
Adapts dashboard template to new v3 fields (source_id, applications, updated custom field keys) and withdrawal UI behavior. |
templates/careers/application/_withdrawal-form.html |
Adds a data attribute to drive “Other” withdrawal reason display without hardcoding the value. |
templates/careers/application/_activate-email.html |
Makes the hiring lead signature resilient when hiring lead data is missing. |
tests/test_greenhouse.py |
Replaces Harvest v1 tests with Harvest v3 auth/client tests and adds coverage for multi-select payload handling. |
tests/test_application.py |
Updates dashboard/withdrawal tests for v3 data shapes and withdrawal reason normalization behavior. |
tests/test_app.py |
Adds tests for v3 question-model building and updates location/is_remote expectations. |
tests/cassettes/TestApplicationPageHelpers.test_job_post_page.yaml |
Removes stale cassette tied to Harvest v1 job post fetching. |
README.md |
Updates local setup docs to require v3 client credentials env vars. |
konf/site.yaml |
Renames deployed env vars/secrets from Harvest API key to v3 client credentials. |
AGENTS.md |
Updates the Careers env var documentation to the v3 client credential names. |
.github/workflows/pr.yaml |
Updates CI env vars to provide v3 client credentials. |
.github/workflows/deploy.yaml |
Updates deploy workflow env vars to provide v3 client credentials. |
.env |
Renames the local env var placeholders to v3 client credentials. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
f189192 to
4cc544c
Compare
Done
Harvestwith a newHarvestV3clientwebapp/application.pyusing v3questions_resolve_withdrawal_reason, so "Other" maps to a real rejection reason id and invalid ids are rejected with a 400.HARVEST_API_KEYtoHARVEST_V3_CLIENT_IDandHARVEST_V3_CLIENT_SECRETacross.env, docs, and site varsQA
dotrunGREENHOUSE_DEBUGenv var is set totruelocalhost:8002/careers/8142329) and compare it with the live prod version. Ensure no differences or gaps.localhost:8002/careers/application/gAAAAABqjbmn56GEEx6pnwXpUxpe1Oiz32z1bbdt_chvEz8ru88aBm1Edf_IYP4R_ZM0KPPQyiueL_84y7pK7he-CGerxb2zsQ==) and compare it with the live prod version. Ensure no differences or gaps. (N.B. HL description was not displaying before, but after this v3 change it shows up now so that should be expected).nathan.clairmonte+ly@canonical.comfor this candidate), select "Other" for the reason, and click withdraw. You should now see the email that would have been sent to the candidate if debug mode were off.